package br.net.woodstock.tickettoride.client.ws.jee;

import java.net.MalformedURLException;
import java.net.URL;

import br.net.woodstock.tickettoride.client.TicketService;
import br.net.woodstock.tickettoride.client.TicketServiceFactory;
import br.net.woodstock.tickettoride.client.ws.jee.internal.TicketServiceWS;
import br.net.woodstock.tickettoride.client.ws.jee.internal.TicketServiceWS_Service;

public class TicketServiceFactoryJEE implements TicketServiceFactory {

	private TicketServiceWS	ws;

	public TicketServiceFactoryJEE(final String url) throws MalformedURLException {
		super();
		TicketServiceWS_Service service = new TicketServiceWS_Service(new URL(url));
		this.ws = service.getTicketServiceWSPort();
	}

	@Override
	public TicketService getTicketService() {
		return new TicketServiceJEE(this.ws);
	}

}
